home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SAVESCRN.SWG / 0010_Graphic Screen Capture.pas < prev    next >
Pascal/Delphi Source File  |  1993-08-27  |  2KB  |  64 lines

  1. {
  2. > Does anyone have any code that will go tsr and dump the pixel colors in a
  3. > 320.256. whatever that mode is into a Text File in the format 200,5,0,0,0,4,
  4. > etc?  just list every pixel followed by a comma?
  5.  
  6. The TSR part would be the hard part, the writing the screen to a File
  7. would be easy.
  8.  
  9. I wrote this little prog just now, not incredibly great but might
  10. actually work and probably will do the job...
  11.  
  12. Be careful as it doesn't check For Dos reentrancy and you might hang
  13. your computer if you try to capture a screen While Dos is doing
  14. something else...
  15.  
  16. by Sean Palmer,
  17. public domain
  18. }
  19.  
  20. Program capture;
  21. Uses
  22.   Dos;
  23.  
  24. Procedure WriteScrn2File;
  25. Var
  26.   f    : Text;
  27.   x, y : Word;
  28. begin
  29.   assign(f,'CAPTURE.SCR');
  30.   reWrite(f);
  31.   For y := 0 to 199 do
  32.     For x := 0 to 319 do
  33.     begin
  34.       Write(f, mem[$A000 : y * 320 + x], ',');
  35.       if x mod 20 = 0 then
  36.         Writeln(f);  {new line every 20 pixels}
  37.     end;
  38.   close(f);
  39. end;
  40.  
  41. Var
  42.   oldIntVec : Procedure;
  43.  
  44. {you need to put a Real check For Dos activity here}
  45.  
  46. Function DosActive : Boolean;
  47. begin
  48.   DosActive := False;
  49. end; {assume no and keep fingers crossed! 8)}
  50.  
  51. Procedure keyHandler; interrupt;
  52. begin
  53.   if port[$60] = 114 then     {if print-screen pressed}
  54.     if not DosActive then {better not press While Dos is doing something}
  55.       WriteScrn2File;
  56.   oldIntVec;  {call old handler}
  57. end;
  58.  
  59. begin
  60.   getIntVec(9, @oldIntVec);
  61.   setIntVec(9, @newIntVec);
  62.   keep(0);  {go TSR}
  63. end.
  64.